package com.renting.modules.sys.entity;

import com.renting.common.entity.BaseEntity;
import com.renting.modules.renting.rentSys.entity.House;

import javax.persistence.*;
import java.util.List;
import java.util.Set;

/**
 * 角色表
 */
@Entity
@Table(name = "SYS_ROLE")
public class Role extends BaseEntity {
    public String useable;//是否可用
    public String enName;//英文名称 中文名称属性继承了弗雷
    public String roleType;//角色类型


    //存放当前角色的所有按钮
    @ManyToMany(cascade = {CascadeType.PERSIST}, fetch = FetchType.EAGER)
    @JoinTable(name = "ROLE_MENU", joinColumns = @JoinColumn(name = "role_id", table = "SYS_ROLE", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "menu_id", referencedColumnName = "id", table = "SYS_MENU"))
    public Set<Menu> menus;



    public Role() {
    }



    public Set<Menu> getMenus() {
        return menus;
    }

    public void setMenus(Set<Menu> menus) {
        this.menus = menus;
    }

    public String getUseable() {
        return useable;
    }

    public void setUseable(String useable) {
        this.useable = useable;
    }

    public String getEnName() {
        return enName;
    }

    public void setEnName(String enName) {
        this.enName = enName;
    }

    public String getRoleType() {
        return roleType;
    }

    public void setRoleType(String roleType) {
        this.roleType = roleType;
    }
}
